<?php include show_tpl('public_uheader.htm'); ?>

<div style="width:100%; height:20px; background:#E9ECF3;"></div>

<?php include show_tpl('public_usider.htm'); ?>

<div id="page-wrapper" class="gray-bg">

	<div class="row wrapper wrapper-content">
      	<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">
							<em class="fa fa-list"></em>
							更改费率
						</div>
					</div>
					<div class="panel-body">
						<div class="content-box">
							<form action="<?php echo url('user-manage-'.$_uid);?>" action="POST" id="form" style="text-align:center;">
                              <table class="table" style="min-width: 800px">
                                  <thead>
                                      <tr>
                                          <th class="text-center" colspan="2">商户费率</th>
                                      </tr>
                                  </thead>
                                  <tbody id="userlist">
                                      <tr>
                                          <td class="text-center">
                                              <input class="form-control" name="rate" value="<?php echo $_user['rate']; ?>">
                                          </td>
										  <td>
                                              商户费率不能低于您自己的费率(<?php echo $user['rate']; ?>)
                                          </td>
                                      </tr>
                                  </tbody>
                              </table>
                              <button class="btn btn-primary" id="submit">提交修改</button>
                          </form>
						</div>
					</div>  
				</div>
			</div>
		</div>
	</div>
</div>

<?php include show_tpl('public_ufooter.htm'); ?>

<script>
	$('#submit').click(function(){
		var $this = $('#submit');
		$this.attr('disabled', '1');
		var postdata = $('#form').serialize();
		$.post($('#form').attr('action'), postdata, function(message){
			alert(message.message);
			if(message.code==1) window.location.reload();
			$this.attr('disabled', false);
		}, 'json');
		return false;
	});
</script>